home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / TwinOpus2 / REXX / DOpus / Root.rexx < prev    next >
OS/2 REXX Batch file  |  1994-10-13  |  1KB  |  51 lines

  1. /*
  2.  *
  3.  * Go to the root directory in TwinExpres from DOpus.
  4.  *
  5.  * (c) 1994 by K.P. van Beem (2:280/464.2, patrick.van.beem@aobh.xs4all.nl)
  6.  *
  7.  * Based on the DOpusLhaARexx package by Geoff Seeley (but you can better
  8.  * use GuiArc in stead of DOpus and a script, to deal with archives)
  9.  *
  10.  */
  11.  
  12. DOpusPort   = 'DOPUS.1'
  13.  
  14. if ~show(l,"rexxsupport.library") then        
  15.     call addlib("rexxsupport.library",0,-30,0)
  16. if showlist('Ports', DOpusPort) = 0 then do
  17.    say 'Directory Opus Arexx port not found. Aborting.'
  18.    exit
  19. end
  20.  
  21. address 'DOPUS.1'
  22. options results
  23.  
  24. /* setup DOpus window and tell user what's happening */
  25. Busy on
  26. TopText "Getting directory of CD, please wait..."
  27.  
  28. /* Get the current directory */
  29. 'Status 6 -1'
  30. GetEntry Result
  31. FilePath = Result
  32. if left(FilePath,1) ~= '*' then do
  33.    TopText "You are not in a 'Twin' directory."
  34.    Busy off
  35.    exit
  36. end
  37. FilePath = SubStr(FilePath,2)
  38. if right(FilePath,1) = ':' then do
  39.    TopText "You are already at the root."
  40.    Busy off
  41.    exit
  42. end
  43. Root=LastPos(':',FilePath)
  44. if Root = 0 then do
  45.    TopText "No root found."
  46.    Busy off
  47.    exit
  48. end
  49. FilePath = Left(FilePath,Root)
  50. address AREXX "Rexx:DOpus/ReadDir.rexx" FilePath
  51.